package com.ssm.dao;



import com.ssm.pojo.DetailShoppingCart;
import com.ssm.pojo.Shoppingcart;

import java.util.List;

/**
 * @program: exercise1_online_shopping
 * @author: qin haojun
 * @create: 2021-02-13 18:28
 */
public interface ShoppingCartMapper {
    //通过userId和status选择购物车，两个参数可有可无
    public List<Shoppingcart> selectCartByUidStatus(Shoppingcart shoppingCart) throws Exception;

    //加入商品时新增购物车
    public void insertShoppingCart(Shoppingcart shoppingCart)throws Exception;

    //通过id更新购物车状态，比如当用户购买了这件商品后status从0（未买）变1（已买）
    public void updateStatusById(Shoppingcart shoppingCart)throws Exception;

    //当用户从购物车中删除商品时删除数据库，通过id删除
    public void deleteShoppingCartById(Integer id)throws Exception;

    //获得一位用户的详细的购物清单，包括货物种类，价格等
    public List<DetailShoppingCart> selectDetailShoppingCart(Integer userId)throws Exception;
}
